package com.wiwl.service;

import org.springframework.beans.factory.annotation.Autowired;

import com.wiwl.service.interfaces.IAvisoService;
import com.wiwl.service.interfaces.IMenuItemService;
import com.wiwl.service.interfaces.IUserService;

public class ServiceLocator {

	private static ServiceLocator INSTANCE;

	private IUserService userService;
	private IMenuItemService menuItemService;
	private IFiltroService filtroService;
	private IAvisoService avisoService;

	// constructor privado
	private ServiceLocator() {/* Singleton */
	}

	public static ServiceLocator getInstance() {
		if (INSTANCE == null) {
			INSTANCE = new ServiceLocator();
		}
		return INSTANCE;
	}

	public static IUserService getUserService() {
		return INSTANCE.userService;
	}

	@Autowired
	public void setUserService(IUserService userService) {
		this.userService = userService;
	}

	public static IMenuItemService getMenuItemService() {
		return INSTANCE.menuItemService;
	}

	@Autowired
	public void setMenuItemService(IMenuItemService menuItemService) {
		this.menuItemService = menuItemService;
	}

	public static IFiltroService getFiltroService() {
		return INSTANCE.filtroService;
	}

	@Autowired
	public void setFiltroService(IFiltroService filtroService) {
		this.filtroService = filtroService;
	}

	public static IAvisoService getAvisoService() {
		return INSTANCE.avisoService;
	}

	@Autowired
	public void setAvisoService(IAvisoService avisoService) {
		this.avisoService = avisoService;
	}

	
}
